import {useNavigate,useSearchParams,useParams,useLocation} from 'react-router-dom'
export default function withRouter(WFC){
    return function(props){
        const navigate=useNavigate()
        const [query]=useSearchParams()
        const params=useParams()
        const {state}=useLocation()
        return <WFC
                {...props} 
                navigate={navigate}
                query={query}
                params={params}
                state={state}></WFC>
    }
}